<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="root">
        <app></app>
    </div>
    <script src="../js/vue.js"></script>
    <script>
        const student = Vue.component('student',{
            template:`
                <div>
                    <h2>{{name}}</h2>
                    <h2>{{age}}</h2>    
                </div>
            `,
            data(){
                return{
                    name:"hjqqqq",
                    age:"24"
                }
            }
        })
        const school = {
            template:`
                <div>
                    <h2>{{name}}</h2>
                    <h2>{{address}}</h2>    <hr/>
                    <student></student>
                </div>
            `,
            data(){
                return{
                    name:"hjjj",
                    address:"地点"
                }
            },
            components:{
                student
            }
        }
        const hello ={
            template:`
                <div>
                    <h2>{{name}}</h2>
                </div>
            `,
            data(){
                return{
                    name:"你好,我是hhhhjjjqq",
                }
            },
        }
        const app ={
            template:`
                <div>
                    <school></school>
                    <hello></hello>
                </div>
            `,
            data(){
                return{
                }
            },
            components:{
                school,hello
            }
        }
        new Vue({
            el: "#root",
            components:{
                app
            }
        })
    </script>
</body>
</html>